include(CTest)

set(target_name ly-unit-tests)

add_executable(${target_name} unit-tests.cpp)


# ---------------------Google Test------------------ #
add_test(${target_name} all_tests.cpp)

# 头文件
target_include_directories(${target_name} PRIVATE 
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

    ${CMAKE_CURRENT_SOURCE_DIR}
    ${GTest_INCLUDE_DIR}
    ${spdlog_INCLUDE_DIR}
    ${EnTT_INCLUDE_DIR}
)

target_link_libraries(${target_name} PRIVATE
    Qt5::Core Qt5::Widgets Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml
    Clipper2::clipper2 Clipper2::clipper2z
    rapidjson
    nlohmann_json::nlohmann_json
    Freetype::Freetype
    glm::glm
    spdlog::spdlog
    EnTT::EnTT
    vsg::vsg
    gdstk::gdstk
    libspatialindex::spatialindex
)

# 库文件
target_link_libraries(${target_name} PRIVATE
    ly
    Qt5::Core Qt5::Widgets Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml
    GTest::gtest GTest::gtest_main 
    Qhull::qhullcpp Qhull::qhullstatic_r
    spdlog::spdlog
    glm::glm
    EnTT::EnTT
    clipper::clipper
    gdstk::gdstk
    libspatialindex::libspatialindex
)
